﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EclipseLib.Shared;
using Microsoft.Xna.Framework;

namespace EclipseLib.Client
{
    public class EMap
    {
        // Data Members
        TileBlock[,] Blocks;

        // Constructor
        public EMap()
        {
            Blocks = new TileBlock[Constants.MapSize.X, Constants.MapSize.Y];
            SetAllBlocks(TileBlock.Open);
        }

        // Methods
        public void SetAllBlocks(TileBlock Value)
        {
            for (int X = 0; X < Constants.MapSize.X; ++X)
                for (int Y = 0; Y < Constants.MapSize.Y; ++Y)
                    Blocks[X, Y] = Value;
        }
        public void ToggleBlock(Point MapPos, TileBlock Value)
        {
            if (ValidateMapPosition(MapPos))
                Blocks[MapPos.X, MapPos.Y] ^= Value;
        }

        // Static Methods
        public static bool ValidateMapPosition(Point MapPos)
        {
            if (MapPos.X < Constants.MapSize.X && MapPos.Y < Constants.MapSize.Y)
                return true;

            return false;
        }
    }
}
